<!--
 * @Description: 
 * @Author: zhangwei
 * @Date: 2023-03-15 20:31:33
 * @LastEditTime: 2023-03-18 17:43:36
 * @LastEditors: zw 775925302@qq.com
-->
<script lang="tsx">

import { defineComponent, onMounted } from 'vue'

import {useFormItemAttr, useFormItemModelValue } from "../../../use/useForm"

export default defineComponent({
    name: 'ZwInput',
    props: {
        schema: {
            type: Object,
            default: function () {
                return {}
            }
        },
        modelValue: {
            type: [Number, String]
        }
    },
    emits: ['update:modelValue'],

    setup(props, { expose, emit}) {

        onMounted(() => {
        })

        //提供方法给父组件调用
        expose({

        })

        const value = useFormItemModelValue(props,emit);

        return () => (
            <el-form-item {...useFormItemAttr(props.schema)}>
                <el-input vModel={value.value} {...props.schema.attrs} style="min-width:190px"></el-input>
            </el-form-item>
        )
    }
})
</script>

<style lang="less" scoped></style>